Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

NURB Curves

A nonuniform rational B-spline (NURB) curve is a three-dimensional projection of a four-dimensional curve, with an optional set of attributes. A NURB curve is defined by the TQ3NURBCurveData data type. See "Creating and Editing NURB Curves" for a description of the routines you can use to create and edit NURB curves. Figure 29 shows a NURB curve.

typedef struct TQ3NURBCurveData {
    unsigned long                       order;
    unsigned long                       numPoints;
    TQ3RationalPoint4D                  *controlPoints;
    float                               *knots;
    TQ3AttributeSet                     curveAttributeSet;
} TQ3NURBCurveData;

Figure 29 A NURB curve

order
The order of the NURB curve. For NURB curves defined by ratios of cubic B-spline polynomials, the order is 4. In general, the order of a NURB curve defined by polynomial equations of degree n is n +1. The value in this field must be greater than 1.
numPoints
The number of control points that define the NURB curve. The value in this field must be greater than or equal to the order of the NURB curve.
controlPoints
A pointer to an array of rational four-dimensional control points that define the NURB curve.
knots
A pointer to an array of knots that define the NURB curve. The number of knots in a NURB curve is the sum of the values in the order and numPoints fields. The values in this array must be nondecreasing (but successive values may be equal, up to a multiplicity equivalent to the order of the curve).
curveAttributeSet
A set of attributes for the NURB curve. The value in this field is NULL if no NURB curve attributes are defined.

© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |